package com.foreknow.springboot.service.impl;

import com.foreknow.springboot.mapper.DeliveryAddressMapper;
import com.foreknow.springboot.po.DeliveryAddress;
import com.foreknow.springboot.service.DeliveryAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@SuppressWarnings({"all"})

/**
 * @author xiaoming
 * @version jdk1.8
 * @date 2022/8/13 19:39
 * @function:
 */
@Service
public class DeliveryAddressMapperServiceImpl implements DeliveryAddressService {
    //注入依赖
    @Autowired
    private DeliveryAddressMapper deliveryAddressMapper;

    @Override
    public List<DeliveryAddress> listDeliveryAddressByUserId(String userId) {
        return deliveryAddressMapper.listDeliveryAddressByUserId(userId);
    }

    @Override
    public DeliveryAddress getDeliveryAddressById(Integer daId) {
        return deliveryAddressMapper.getDeliveryAddressById(daId);
    }

    @Override
    public int saveDeliveryAddress(String contactName, Integer contactSex, String contactTel, String address, String userId) {
        return deliveryAddressMapper.saveDeliveryAddress(contactName,contactSex,contactTel,address,userId);
    }

    @Override
    public int updateDeliveryAddress(Integer daId, String contactName, Integer contactSex, String contactTel, String address, String userId) {
        return deliveryAddressMapper.updateDeliveryAddress(daId,contactName,contactSex,contactTel,address,userId);
    }

    @Override
    public int removeDeliveryAddress(Integer daId) {
        return deliveryAddressMapper.removeDeliveryAddress(daId);
    }
}
